<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>POS收单运营管理平台</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<s:url value="/css/common.css"/>" type="text/css" rel="stylesheet" />
	
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript">

	$(document).ready(
			function() {
				var msg="${dealFlag}";
				if(msg=='2')
				{
					refreshTab('C_07_M_03');//根据菜单索引刷新对应的tabpanel
				}
			});

	  function showPosInfoWindow(str){
    
     var ScreenWidth = screen.availWidth ;
     var ScreenHeight = screen.availHeight; 
     var StartX = (ScreenWidth - innerWidth) / 2 ;
     var StartY = (ScreenHeight - innerHeight) / 2 ;
	 var url =  "<%=basePath %>termAgentSn/termSnAgentInit.ct?serNums="+str;
	
	 window.open(url, '终端序列号信息', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ', resizable=no, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no'); 
	}
	
	
	function deal(){
	$("#term").attr("disabled","true");
	  var flag = $("#dealFlag").val();
	  
	  if(flag=="1"){
	    formSubmit();
		}
	}
	
	function formSubmit(){
	    $("#queryUserForm").attr("action","<%=basePath%>/termAgentSn/terminalSnUnbund.ct");
		$("#queryUserForm").submit();		
	}
	
	function refreshTab(index)
	{
		var parentWindow=window.parent.parent.document.getElementById("framemain").contentWindow;
		var posision=parentWindow.tabpanel.getTabPosision(index);
		if(!isNaN(posision))
		{
			parentWindow.frames[posision].document.getElementById("queryUserForm").submit();
		}
	}
	
	function backForm()
	{
		var parentWindow=window.parent.parent.document.getElementById("framemain").contentWindow;
		parentWindow.tabpanel.kill('bind');
	}
</script>



</head>

<body>

	<div class="bt-box">
		<s:form id="queryUserForm"  method="post"
			theme="simple">
			<table id="istable" class="tb">
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				<tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">
							终端解绑/绑定
						</div>
					</td>
				</tr>
				<tr class="tb-line">					
					<td class="tb-td" align="right" width="20%">商户号：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.id"/></td>
					<td class="tb-td" align="right" width="20%">商户名称：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.nameBusi"/></td>
				    <td class="tb-td" align="right" width="20%">商户状态：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.status"/></td>
				</tr>
				<tr class="tb-line">
					<td class="tb-td" align="right" width="20%">业务联系人：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.contactName"/></td>
					<td class="tb-td" align="right" width="20%">联系电话：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.contactPhoneNo"/></td>
				    <td class="tb-td" align="right" width="20%">终端状态：</td>
					<td class="tb-td" align="left"><%-- <s:property value="termInfos.status"/> --%>
						<s:if test="termInfos.status=='01'">
							正常
						</s:if>
						<s:elseif test="termInfos.status=='02'">
							已解绑
						</s:elseif>
						<s:else>
							已冻结
						</s:else>
					</td>
				</tr>
				
				<tr class="tb-line">
					<s:hidden name="mid" value="%{termInfos.id.MchtCd}"/>
					<s:hidden name="tid" value="%{termInfos.id.TermId}"/>
					<s:hidden name="nowserialNum" value="%{termInfos.DeviceCd}"/>
					<s:hidden name="posBrandCode" value="%{yjPos.posBrandCode}"/>
					<td class="tb-td" align="right" width="20%">终端号：</td>
					<td class="tb-td" align="left"><s:property value="termInfos.id.TermId"/></td>
					<td class="tb-td" align="right" width="20%">门店名称：</td>
					<td class="tb-td" align="left"><s:property value="tblMchtInf.name"/></td>
				    <td class="tb-td" align="right" width="20%">安装地址：</td>
					<td class="tb-td" align="left"><s:property value="termInfos.Installlocation"/></td>
				</tr>
				
				<tr class="tb-line">				
					<td class="tb-td" align="right" width="20%">终端序列号：</td>
					<td class="tb-td" align="left">
					<s:property value="yjPos.serialNum"/>
					</td>
					<td class="tb-td" align="right" width="20%">终端主密钥索引：</td>
					<td class="tb-td" align="left"><s:property value="yjPos.tekId"/></td>
				    <td class="tb-td" align="right" width="20%">品牌：</td>
					<td class="tb-td" align="left"><s:property value="yjPos.posBrand"/></td>
				</tr>				
				<tr class="tb-line">
					<td class="tb-td" align="right" width="20%">机型：</td>
					<td class="tb-td" align="left"><s:property value="yjPos.posType"/></td>
					<td class="tb-td" align="right" width="20%">名称：</td>
					<td class="tb-td" align="left"><s:property value="yjPos.posName"/></td>
					<td class="tb-td" align="left" colspan="2"></td>
				</tr>

				
				<tr class="tb-line">
						<td class="tb-td" colspan="6" align="center">
						<span style="font-color: red;"><s:actionerror /></span>
						<span style="font-color: red;"><s:actionmessage /></span > 
						<span style="font-color: red;"><s:fielderror cssClass="fieldError" /></span>
						<span style="font-color: red;" id="otherError"></span>
						</td>
					</tr>				
				
				<tr class="tb-line">
					<td class="tb-td line-submit" colspan="6" align="center">
					<s:hidden name="dealFlag" id="dealFlag" value="%{#request.dealFlag}"/>
						<s:if test="#request.dealFlag ==1">
						    <s:if test="termInfos.status=='01'">
							  <label class="tb-input-submit"><s:submit id="term" value="解绑" onclick="deal()"/></label>
							</s:if>
							<s:else>
							   <label class="tb-input-submit"><s:submit disabled="true" id="term" value="解绑" onclick="deal()"/></label>
							</s:else>
						</s:if>
						<label class="tb-input-submit"><input type="button" value="返回" onclick="backForm()"/></label>
					</td>
				</tr>
				<s:if test="termInfos.status=='00'">
					
				<tr class="tb-line">
					<td class="tb-td" colspan="6" align="center">【请解冻终端后，再进行解绑操作】</td>
					</tr>
				</s:if>
				</table>			
		</s:form>
						
	</div>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			$("#term").attr("disabled","true");
		</script>
	</s:if>
</body>
</html>
